package com.typy.www.tpay.ui.acitivity;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AbsListView.LayoutParams;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.typy.www.tpay.R;
import com.typy.www.tpay.base.BaseBackActivity;
import com.typy.www.tpay.ui.prt.PtrScrollContent;
import com.typy.www.tpay.util.listviewanimations.IntentUtil;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by 13799 on 2018/7/8.
 */

public class ZpayActivity extends BaseBackActivity {

    PtrScrollContent ptrScrollContent;
    @BindView(R.id.tv_buy)
    TextView tvBuy;
    @BindView(R.id.tv_sell)
    TextView tvSell;


    public static void show(Context context) {
        IntentUtil.intent2Activity(context, ZpayActivity.class);
    }

    @Override
    protected void initView() {
        super.initView();
    }

    @Override
    protected int getTitleBarResId() {
        return -1;
    }

    @Override
    protected View getContentView() {
        LinearLayout linearLayout = (LinearLayout) LayoutInflater.from(getActivity()).inflate(R.layout.activity_linear, null);
        ptrScrollContent = new PtrScrollContent(getActivity(), R.layout.activity_zpay) {
            @Override
            protected void getPage(int pageIndex, boolean refresh) {

            }
        };
        LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, 1);
        linearLayout.addView(ptrScrollContent.getmView(), params);
        View layout = (LinearLayout) LayoutInflater.from(getActivity()).inflate(R.layout.foot_zpay, null);
        linearLayout.addView(layout);
        return linearLayout.getRootView();
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @OnClick({R.id.tv_buy, R.id.tv_sell})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.tv_buy:
                tvBuy.setTextColor(getResources().getColor(R.color.text_moneyred));
                tvSell.setTextColor(getResources().getColor(R.color.text_darkcolor));
                break;
            case R.id.tv_sell:
                tvBuy.setTextColor(getResources().getColor(R.color.text_darkcolor));
                tvSell.setTextColor(getResources().getColor(R.color.text_moneyred));
                break;
        }
    }
}
